/** \file MemDump.cc
 * Definition of the MemDump function.
 *
 * (c) Copyright  Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: MemDump.cc 119 2006-06-21 04:57:25Z semihc $
 *
 *
 */

#include "MemDump.hpp"
#include <sstream>
#include <iomanip>

using namespace std;
using namespace TC;


TC_IDENT("$Id$");


string TC::MemToString(const unsigned char* mem, unsigned size)
{
  ostringstream os;

  os << hex;
  for(unsigned i=0; i<size; ++i)
    os << setw(2) << setfill('0') 
       << static_cast<unsigned short>(mem[i]);

  return os.str();
}
